home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / sql / SQLException.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  2.8 KB  |  125 lines

  1. package java.sql;
  2.  
  3. import java.util.Iterator;
  4. import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
  5.  
  6. public class SQLException extends Exception implements Iterable<Throwable> {
  7.    private String SQLState;
  8.    private int vendorCode;
  9.    private volatile SQLException next;
  10.    private static final AtomicReferenceFieldUpdater<SQLException, SQLException> nextUpdater = AtomicReferenceFieldUpdater.newUpdater(SQLException.class, SQLException.class, "next");
  11.    private static final long serialVersionUID = 2135244094396331484L;
  12.  
  13.    public SQLException(String var1, String var2, int var3) {
  14.       super(var1);
  15.       this.SQLState = var2;
  16.       this.vendorCode = var3;
  17.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  18.          DriverManager.println("SQLState(" + var2 + ") vendor code(" + var3 + ")");
  19.          this.printStackTrace(DriverManager.getLogWriter());
  20.       }
  21.  
  22.    }
  23.  
  24.    public SQLException(String var1, String var2) {
  25.       super(var1);
  26.       this.SQLState = var2;
  27.       this.vendorCode = 0;
  28.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  29.          this.printStackTrace(DriverManager.getLogWriter());
  30.          DriverManager.println("SQLException: SQLState(" + var2 + ")");
  31.       }
  32.  
  33.    }
  34.  
  35.    public SQLException(String var1) {
  36.       super(var1);
  37.       this.SQLState = null;
  38.       this.vendorCode = 0;
  39.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  40.          this.printStackTrace(DriverManager.getLogWriter());
  41.       }
  42.  
  43.    }
  44.  
  45.    public SQLException() {
  46.       this.SQLState = null;
  47.       this.vendorCode = 0;
  48.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  49.          this.printStackTrace(DriverManager.getLogWriter());
  50.       }
  51.  
  52.    }
  53.  
  54.    public SQLException(Throwable var1) {
  55.       super(var1);
  56.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  57.          this.printStackTrace(DriverManager.getLogWriter());
  58.       }
  59.  
  60.    }
  61.  
  62.    public SQLException(String var1, Throwable var2) {
  63.       super(var1, var2);
  64.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  65.          this.printStackTrace(DriverManager.getLogWriter());
  66.       }
  67.  
  68.    }
  69.  
  70.    public SQLException(String var1, String var2, Throwable var3) {
  71.       super(var1, var3);
  72.       this.SQLState = var2;
  73.       this.vendorCode = 0;
  74.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  75.          this.printStackTrace(DriverManager.getLogWriter());
  76.          DriverManager.println("SQLState(" + this.SQLState + ")");
  77.       }
  78.  
  79.    }
  80.  
  81.    public SQLException(String var1, String var2, int var3, Throwable var4) {
  82.       super(var1, var4);
  83.       this.SQLState = var2;
  84.       this.vendorCode = var3;
  85.       if (!(this instanceof SQLWarning) && DriverManager.getLogWriter() != null) {
  86.          DriverManager.println("SQLState(" + this.SQLState + ") vendor code(" + var3 + ")");
  87.          this.printStackTrace(DriverManager.getLogWriter());
  88.       }
  89.  
  90.    }
  91.  
  92.    public String getSQLState() {
  93.       return this.SQLState;
  94.    }
  95.  
  96.    public int getErrorCode() {
  97.       return this.vendorCode;
  98.    }
  99.  
  100.    public SQLException getNextException() {
  101.       return this.next;
  102.    }
  103.  
  104.    public void setNextException(SQLException var1) {
  105.       SQLException var2 = this;
  106.  
  107.       while(true) {
  108.          SQLException var3 = var2.next;
  109.          if (var3 != null) {
  110.             var2 = var3;
  111.          } else {
  112.             if (nextUpdater.compareAndSet(var2, (Object)null, var1)) {
  113.                return;
  114.             }
  115.  
  116.             var2 = var2.next;
  117.          }
  118.       }
  119.    }
  120.  
  121.    public Iterator<Throwable> iterator() {
  122.       return new 1(this);
  123.    }
  124. }
  125.